<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    #box {
        width: 600px;
        height: 500px;
        margin: 0 auto;
    }
    </style>
    <script src="./echarts.min.js"></script>
</head>
<body>
    <div id="box"></div>
    <script>
        let box = document.querySelector('#box');
        let chart = echarts.init(box);
        chart.setOption({
            title: {
                text: '主标题',
                subtext: '2017年度',
            },
            legend: {
                data: ['男','女'],
                right: '0px',
                top: '50%',
                orient: 'vertical',
            },
            xAxis: [
                {
                    type: 'category',
                    data: ['1月', '2月', '3月', '4月', '5月', '6月']
                }
            ],
            yAxis: [
                {
                    type: 'value'
                }
            ],
            series: [
                {
                    name: '男',
                    type: 'bar',
                    data: [785, 500, 30, 541, 363, 189]
                },
                {
                    name: '女',
                    type: 'bar',
                    data: [471, 397, 50, 381, 549, 224]
                }
            ]

        });
    </script>
</body>
</html>
